package ca.usherbrooke.application.astar;

import java.io.Serializable;

import ca.usherbrooke.application.astar.location.ILocation;

public class Road implements Serializable {
	private static final long serialVersionUID = 1L;

	protected ILocation origine;
	protected ILocation destination;

	public Road(ILocation origine, ILocation destination) {
		this.origine = origine;
		this.destination = destination;
	}

	public Float getSpeedFactor() {
		return (origine.getSpeedFactor() + destination.getSpeedFactor()) / 2.0f;
	}

	public Float getLongueur() {
		return origine.getDistance(destination);
	}

	/*
	 * GETTER ET SETTER
	 */
	public ILocation getDestination() {
		return destination;
	}

	public void setDestination(ILocation destination) {
		this.destination = destination;
	}

	public ILocation getOrigine() {
		return origine;
	}

	public void setOrigine(ILocation origine) {
		this.origine = origine;
	}
}
